#!/bin/bash

set -e

function install_jar() {
    local file=$1
    local artifactId=$2
    
    echo "Installing ${file}..."
    mvn install:install-file \
        -Dfile=${file} \
        -DgroupId=cn.bluetron.supos \
        -DartifactId=${artifactId} \
        -Dversion=1.0.1 \
        -Dpackaging=jar
    echo "Successfully installed ${file}"
}

install_jar "openapi-httpclient-core.jar" "openapi-httpclient-core"
install_jar "openapi-httpclient-httpclient5.jar" "openapi-httpclient-httpclient5"
install_jar "openapi-httpclient-boot-starter.jar" "openapi-httpclient-boot-starter"